import request from './request'


// 教师注册
export const teacherLogin = (info) => {
    return request({
        url: "/api/school/teacher/login",
        method: "post",
        data: info
    })
}

// 教师注册
export const teacherRegister = (info) => {
    return request({
        url: "/api/school/teacher/register",
        method: "post",
        data: info
    })
}

// 班主任查看学生信息
export const students_score = (info) => {
    return request({
        url: "/api/school/teacher/allScore",
        method: "post",
        data: info
    })
}

// 查询当前班级所修课程
export const getCurriculum = (info) => {
    return request({
        url: "/api/school/class-curr",
        method: "get",
        params: info
    })
}

// 班主任查询当前班级科任老师
export const getTeacherList = (params) => {
    return request({
        url: "/api/school/teacher/teacherList",
        method: "get",
        params: params
    })
}

// 科任老师查找所教年级
export const getGrade = (params) => {
    return request({
        url: "/api/school/teacher/grade",
        method: "get",
        params: params
    })
}

// 科任老师查找所教班级的班级名
export const getClass = (params) => {
    return request({
        url: "/api/school/teacher/classname",
        method: "get",
        params: params
    })
}

// 科任老师查找所教班级
export const getStudentsOfCurr = (params) => {
    return request({
        url: "/api/school/teacher/studentofcurr",
        method: "post",
        data: params
    })
}

// 学校管理人员查询所有教师
export const getTeachers = (params) => {
    return request({
        url: "/api/school/teacher/teachers",
        method: "post",
        data: params
    })
}

// 学校管理人员删除教师
export const delTeachers = (params) => {
    return request({
        url: "/api/school/teacher/delteachers",
        method: "delete",
        data: params
    })
}

// 学校管理人员查询所有班级
export const getClassManage= (params) => {
    return request({
        url: "/api/school/class/getClass",
        method: "post",
        data: params
    })
}

// 学校管理人员删除教师
export const delClass = (params) => {
    return request({
        url: "/api/school/class/delClass",
        method: "delete",
        data: params
    })
}

// 学校管理人员获取空闲教师
export const teacherNull = (params) => {
    return request({
        url: "/api/school/class/teachers",
        method: "get",
        params: params
    })
}

// 学校管理人员添加班级
export const addClass= (params) => {
    return request({
        url: "/api/school/class",
        method: "post",
        data: params
    })
}

// 学校管理人员修改班级信息
export const editClass = (params) => {
    return request({
        url: "/api/school/class/edit",
        method: "put",
        data: params
    })
}

// 学校管理人员查询课程关系
export const getClassCurr = (params) => {
    return request({
        url: "/api/school/class-curr/class-curr",
        method: "post",
        data: params
    })
}

// 学校管理人员查询所有年级
export const getAllGrade = () => {
    return request({
        url: "/api/school/class-curr/grade",
        method: "get"
    })
}

// 学校管理人员查询所有班级
export const getAllClass = () => {
    return request({
        url: "/api/school/class/getAllClass",
        method: "get"
    })
}

// 学校管理人员查询所有课程
export const getAllCurr = () => {
    return request({
        url: "/api/school/curriculum/getAllCurr",
        method: "get"
    })
}

// 学校管理人员查询指定年级下所有班级
export const getClassOfGrade = (params) => {
    return request({
        url: "/api/school/class-curr/classname",
        method: "get",
        params: params
    })
}

// 学校管理人员查询所有该年级下的课程
export const getCurrOfGrade = (params) => {
    return request({
        url: "/api/school/class-curr/curr",
        method: "get",
        params: params
    })
}

// 学校管理人员查询有教指定课程或者暂无课程的教师
export const getTeacherOfCurr = (params) => {
    return request({
        url: "/api/school/class-curr/teacher",
        method: "get",
        params: params
    })
}

// 学校管理人员添加课程关系
export const addClassCurr = (params) => {
    return request({
        url: "/api/school/class-curr/add",
        method: "post",
        data: params
    })
}

// 学校管理人员删除课程关系
export const delClassCurr = (params) => {
    return request({
        url: "/api/school/class-curr/del",
        method: "delete",
        data: params
    })
}

// 学校管理人员修改课程关系
export const editClassCurr = (params) => {
    return request({
        url: "/api/school/class-curr/edit",
        method: "put",
        data: params
    })
}

// 学校管理人员获取所有学生信息
export const getAllStudent = (params) => {
    return request({
        url: "/api/school/student/getAll",
        method: "post",
        data: params
    })
}

// 学校管理人员删除指定学生信息
export const delStudent = (params) => {
    return request({
        url: "/api/school/student",
        method: "delete",
        data: params
    })
}

// 班级助理获取本班学生成绩
export const getScore = (params) => {
    return request({
        url: "/api/school/teacher/getScore",
        method: "post",
        data: params
    })
}

// 学校管理人员获取所有课程
export const getAllCurriculum = (params) => {
    return request({
        url: "/api/school/curriculum/getAll",
        method: "post",
        data: params
    })
}

// 学校管理人员删除课程
export const delCurriculum = (params) => {
    return request({
        url: "/api/school/curriculum",
        method: "delete",
        data: params
    })
}

// 学校管理人员修改课程
export const editCurriculum = (params) => {
    return request({
        url: "/api/school/curriculum",
        method: "put",
        data: params
    })
}

// 学校管理人员添加课程
export const addCurriculum = (params) => {
    return request({
        url: "/api/school/curriculum",
        method: "post",
        data: params
    })
}

// 用户获取权限路由
export const getUserRouters = (params) => {
    return request({
        url: "/api/school/teacher/router",
        method: "get",
        params: params
    })
}

// 用户上传头像
export const saveUpload = (params) => {
    return request({
        url: "/api/school/teacher/upload",
        method: "post",
        data: params
    })
}

// 用户获取头像
export const getUpload = (params) => {
    return request({
        url: "/api/school/teacher/upload",
        method: "get",
        params: params
    })
}